package com.my.study.service.Impl;

import com.my.study.convert.UserRoleResponseConvert;
import com.my.study.entity.UserRole;
import com.my.study.mapper.UserRoleMapper;
import com.my.study.service.UserRoleService;
import com.my.study.vo.UserRoleVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserRoleServiceImpl implements UserRoleService {

    @Autowired
    private UserRoleMapper userRoleMapper;
    @Autowired
    private UserRoleResponseConvert userRoleResponseConvert;

    @Override
    public List<UserRoleVO> queryUserRoleInfo(String userId) {
        List<UserRole> userRoles = userRoleMapper.selectByPrimaryKey(userId);
        return userRoleResponseConvert.toTargetList(userRoles);
    }
}
